package cn.iocoder.yudao.module.shop.dal.mysql.shopSettleApply;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.shopSettleApply.ShopSettleApplyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.shopSettleApply.vo.*;

/**
 * 商户入驻申请 Mapper
 *
 * @author 吕小文
 */
@Mapper
public interface ShopSettleApplyMapper extends BaseMapperX<ShopSettleApplyDO> {

    default PageResult<ShopSettleApplyDO> selectPage(ShopSettleApplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopSettleApplyDO>()
                .likeIfPresent(ShopSettleApplyDO::getNickName, reqVO.getNickName())
                .eqIfPresent(ShopSettleApplyDO::getMobile, reqVO.getMobile())
                .eqIfPresent(ShopSettleApplyDO::getSex, reqVO.getSex())
                .eqIfPresent(ShopSettleApplyDO::getResidenceAddress, reqVO.getResidenceAddress())
                .eqIfPresent(ShopSettleApplyDO::getApplyReason, reqVO.getApplyReason())
                .eqIfPresent(ShopSettleApplyDO::getIsLocal, reqVO.getIsLocal())
                .eqIfPresent(ShopSettleApplyDO::getProvince, reqVO.getProvince())
                .eqIfPresent(ShopSettleApplyDO::getCity, reqVO.getCity())
                .eqIfPresent(ShopSettleApplyDO::getDistrict, reqVO.getDistrict())
                .eqIfPresent(ShopSettleApplyDO::getStatus, reqVO.getStatus())
                .eqIfPresent(ShopSettleApplyDO::getSubmitIp, reqVO.getSubmitIp())
                .eqIfPresent(ShopSettleApplyDO::getSubmitIpBelong, reqVO.getSubmitIpBelong())
                .eqIfPresent(ShopSettleApplyDO::getKnowSource, reqVO.getKnowSource())
                .orderByDesc(ShopSettleApplyDO::getId));
    }

}